package com.zhuchaooasystem.adapter.holder;

import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.zhuchaooasystem.R;

import java.util.Map;

/**
 * @author yinsi
 */

public class OAHolder extends BaseViewHolder<Map<String, Object>> {

    private ImageView iv_menu;
    private TextView txt_menu;

    public OAHolder(ViewGroup parent) {
        super(parent, R.layout.item_frag_oa_menu);
        iv_menu = $(R.id.item_frag_oa_iv_menu);
        txt_menu = $(R.id.item_frag_oa_txt_menu);
    }

    @Override
    public void setData(final Map<String, Object> map) {
        //----
        final int icon = (int) map.get("icon");
        final String name = (String) map.get("name");
        //----
        iv_menu.setBackgroundResource(icon);
        txt_menu.setText(name);

    }

}
